package packet1;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String  string = in.nextLine();
        char[] ch = string.toCharArray();
        for(int i = 0; i < string.length(); i++) {
            if(ch[i] >= 'a' && ch[i] <= 'z') {
                ch[i] = (char)(ch[i] - 32);
                continue;
            }
            if(ch[i] >= 'A' && ch[i] <= 'Z') {
                ch[i] = (char)(ch[i]-'A'+'a');
            }
        }
        System.out.println(new String(ch));
    }
}
/*
asdj33&&%SI
大小写相差32，小写更大asci
 */
